import request from "@/router/axios";

export const getList = (current, size, params) => {
  return request({
    url: "/api/server-user/admin/user/page",
    method: "get",
    params: {
      ...params,
      current,
      size,
    },
  });
};

export const getDetail = (id) => {
  return request({
    url: "/api/server-user/admin/user/info",
    method: "get",
    params: {
      id,
    },
  });
};

export const remove = (ids) => {
  return request({
    url: "/api/server-user/admin/user/remove",
    method: "post",
    params: {
      ids,
    },
  });
};

export const add = (row) => {
  return request({
    url: "/api/server-user/admin/user/save",
    method: "post",
    data: row,
  });
};

export const update = (row) => {
  return request({
    url: "/api/server-user/admin/user/update",
    method: "post",
    data: row,
  });
};

export const updateStatus = (row) => {
  return request({
    url: "/api/server-user/admin/user/update/status",
    method: "post",
    data: row,
  });
};

export const resetPassword = (ids) => {
  return request({
    url: "/api/server-user/admin/user/reset/password",
    method: "post",
    params: {
      ids,
    },
  });
};

export const userWalletList = (current, size, params) => {
  return request({
    url: "/api/server-user/admin/user/wallet/page",
    method: "get",
    params: {
      ...params,
      current,
      size,
    },
  });
};

export const userWalletSave = (form) => {
  return request({
    url: "/api/server-user/admin/user/wallet/save",
    method: "post",
    data: form,
  });
};

export const userTransfer = (form) => {
  return request({
    url: "/api/server-user/admin/user/update/pid",
    method: "post",
    data: form,
  });
};

export const getUserLazyTree = (parentId) => {
  return request({
    url: "/api/server-user/admin/user/lazy-tree",
    method: "get",
    params: {
      parentId,
    },
  });
};

export const realNameAudit = (form) => {
  return request({
    url: "/api/server-user/admin/user/realName/audit",
    method: "post",
    data: form,
  });
};

export const otherdividend = (form) => {
  return request({
    url: "/api/server-biz/admin/other/dividend",
    method: "post",
    data: form,
  });
};
